<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>registertreate.jsp | JavaWeb 源码参考</title>
    <meta name="description" content="Just playing around">
    <link rel="stylesheet" href="/exp/sourceCodeDir/assets/style.c3210e46.css">
    <link rel="modulepreload" href="/exp/sourceCodeDir/assets/app.4da14fe0.js">
    <link rel="modulepreload" href="/exp/sourceCodeDir/assets/javaexp_exp3_Q2_registertreate.md.b14dd5f9.lean.js">
    
    <meta name="twitter:title" content="registertreate.jsp | JavaWeb 源码参考">
  <meta property="og:title" content="registertreate.jsp | JavaWeb 源码参考">
  </head>
  <body>
    <div id="app"><!--[--><div class="theme"><header class="nav-bar" data-v-675d8756><div class="sidebar-button" data-v-675d8756><svg class="icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z" class></path></svg></div><a class="nav-bar-title" href="/exp/sourceCodeDir/" aria-label="JavaWeb 源码参考, back to home" data-v-675d8756 data-v-cc01ef16><!----> JavaWeb 源码参考</a><div class="flex-grow" data-v-675d8756></div><div class="nav" data-v-675d8756><!----></div><!--[--><!--]--></header><aside class="sidebar" data-v-83e92a68><!----><!--[--><!--]--><ul class="sidebar-links" data-v-83e92a68><!--[--><li class="sidebar-link"><a class="sidebar-link-item" href="#registertreate-jsp">registertreate.jsp</a><!----></li><!--]--></ul><!--[--><!--]--></aside><div class="sidebar-mask"></div><main class="page" data-v-7eddb2c4><div class="container" data-v-7eddb2c4><!--[--><!--]--><div style="position:relative;" class="content" data-v-7eddb2c4><div><h2 id="registertreate-jsp" tabindex="-1">registertreate.jsp <a class="header-anchor" href="#registertreate-jsp" aria-hidden="true">#</a></h2><div class="language-html line-numbers-mode"><pre><code>&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html;charset=UTF-8&quot; pageEncoding=&quot;UTF-8&quot;%&gt;
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>html</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>head</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>title</span><span class="token punctuation">&gt;</span></span>注册处理<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>title</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>head</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>body</span><span class="token punctuation">&gt;</span></span>
    &lt;%!
    public class User {
    private String userName;
    private String passWord;
    private String userRealName;
    private String pId;
    private String sex;
    private String interestStr;
    public User(String userName, String passWord, String userRealName, String pId, String sex, String interestStr) {
        this.userName = userName;
        this.passWord = passWord;
        this.userRealName = userRealName;
        this.pId = pId;
        this.sex = sex;
        this.interestStr = interestStr;
        }
    public String toString() {
        return (&quot;用户名：&quot; + userName + &quot;<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>br</span><span class="token punctuation">&gt;</span></span>真实姓名：&quot; + userRealName + &quot;<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>br</span><span class="token punctuation">&gt;</span></span>编号：&quot; + pId + &quot;<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>br</span><span class="token punctuation">&gt;</span></span>性别：&quot; + sex + &quot;<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>br</span><span class="token punctuation">&gt;</span></span>兴趣：&quot; + interestStr);
        }
    }
    %&gt;

    &lt;%
        request.setCharacterEncoding(&quot;UTF-8&quot;);
        String userName = request.getParameter(&quot;userName&quot;);
        String passWord = request.getParameter(&quot;passWord&quot;);
        String userRealName = request.getParameter(&quot;userRealName&quot;);
        String sex = request.getParameter(&quot;sex&quot;);
        String pId = request.getParameter(&quot;pId&quot;);
        String[] interests = request.getParameterValues(&quot;interest&quot;);
        String interestStr = &quot;&quot;;
        for (int i = 0; i &lt; interests.length; i++) {
            interestStr += &quot;,&quot; + interests[i];
        }
        if (interests.length &gt; 0) {
            interestStr = interestStr.substring(1);
        }
        User u = new User(userName, passWord, userRealName, pId, sex, interestStr);
    %&gt;
&lt;%=u.toString()%&gt;
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>body</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>html</span><span class="token punctuation">&gt;</span></span>
</code></pre><div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br></div></div></div></div><footer class="page-footer" data-v-7eddb2c4 data-v-07c132fc><div class="edit" data-v-07c132fc><div class="edit-link" data-v-07c132fc data-v-1ed99556><!----></div></div><div class="updated" data-v-07c132fc><!----></div></footer><!----><!--[--><!--]--></div></main></div><!----><!--]--></div>
    <script>__VP_HASH_MAP__ = JSON.parse("{\"index.md\":\"ee6df597\",\"javaexp_exp3_q1_inputdata.md\":\"4c9db60f\",\"javaexp_exp3_q1_showresult.md\":\"c73ff51d\",\"javaexp_exp3_q2_register.md\":\"71c43148\",\"javaexp_exp3_q2_registertreate.md\":\"b14dd5f9\",\"javaexp_exp3_q3_login.md\":\"a7a466ad\",\"javaexp_exp3_q3_login2.md\":\"dee5f540\",\"javaexp_exp3_q4_info.md\":\"f2e8cc58\",\"javaexp_exp3_q4_showinfo.md\":\"a8ab9dab\",\"javaexp_exp3_q5_computer.md\":\"30518406\",\"javaexp_exp3_q5_inputstring.md\":\"2481a541\",\"javaexp_exp3_q6_c1.md\":\"5c22a939\",\"javaexp_exp3_q6_guess.md\":\"1ef4e595\",\"javaexp_exp3_q7_page.md\":\"7d49e97b\",\"javaexp_exp3_q8_hello.md\":\"32c20507\",\"javaexp_exp3_q8_index.md\":\"4a53af58\",\"javaexp_exp4_q1_info.md\":\"1600b0e0\",\"javaexp_exp4_q1_showinfofruit.md\":\"efefd119\",\"javaexp_exp4_q2_index.md\":\"f0d94be9\",\"javaexp_exp4_q2_login.md\":\"3ae2aa9e\",\"javaexp_exp4_q4_info.md\":\"1064834a\",\"javaexp_exp4_q4_showinfo.md\":\"4226d589\",\"javaexp_exp4_q5_show.md\":\"930cd8f8\",\"javaexp_exp5_input.md\":\"0ab37e25\",\"javaexp_exp5_showinfopro.md\":\"94077118\",\"javaexp_exp6_circle.md\":\"5c028c6b\",\"javaexp_exp6_dbconnection.md\":\"e08ba74c\",\"javaexp_exp6_geoquestionadd.md\":\"8134a7a2\",\"javaexp_exp6_question.md\":\"f3ee8057\",\"javaexp_exp6_questionbank.md\":\"532f8407\",\"javaexp_exp6_recodelist.md\":\"5362ae6b\",\"javaexp_exp6_inputradius.md\":\"9e8050b5\",\"javaexp_exp7_calcircle.md\":\"c04e0244\",\"javaexp_exp7_characterencodingfilter.md\":\"99bd3915\",\"javaexp_exp7_dbconnection.md\":\"7b46e82e\",\"javaexp_exp7_question.md\":\"3a942d62\",\"javaexp_exp7_questionbank.md\":\"529cd18a\",\"javaexp_exp7_questionedit.md\":\"01233cdd\",\"javaexp_exp7_questioneditservlet.md\":\"ac703675\",\"javaexp_exp7_inputradius.md\":\"538a0758\",\"javaexp_exp7_web.md\":\"9465b888\",\"javaexp_exp8_calservlet.md\":\"c7891303\",\"javaexp_exp8_characterencodingfilter.md\":\"a4ed8426\",\"javaexp_exp8_dbconnection.md\":\"398a801d\",\"javaexp_exp8_question.md\":\"3744cb06\",\"javaexp_exp8_questionbank.md\":\"3f2ab31c\",\"javaexp_exp8_questioncontrollerservlet.md\":\"ff9b414a\",\"javaexp_exp8_triangle.md\":\"140b01f0\",\"javaexp_exp8_inputtriangle.md\":\"7b6f4d51\",\"javaexp_exp8_web.md\":\"0dcc78cd\"}")</script>
    <script type="module" async src="/exp/sourceCodeDir/assets/app.4da14fe0.js"></script>
    
  </body>
</html>